import {request} from "@/http";
import type { PublishHole, TreeList} from "@/http/tree/module/treeHole";
import type {LocationQueryValue} from "vue-router";


// 获取树洞列表
const getHole = function (data: TreeList) {
    return request({method: 'get', url: '/treeHole/hole/list', data: data})

}

// 发布新树洞
const publishNew = function (data: PublishHole) {
    return request({method: 'post', url: '/treeHole/hole/add', data: data})
}

// 树洞详情
const holeDetail = function (id: string | null | LocationQueryValue[] | number) {
    return request({method: 'get', url: `/treeHole/hole/details/${id}`})
}
// 树洞删除
const holeDelete = function (data: any) {
    return request({method: 'post', url: '/treeHole/hole/delete', data})

}
export {getHole, publishNew, holeDetail, holeDelete}